package com.fit.dao.transport;

import java.util.List;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.hibernate.Session;

import com.fit.entities.Destination;
import com.fit.entities.Transport;

public class TransportDAOImpl implements TransportDAO {

	@Inject
	private Session session;

	public boolean save(Transport transport) {
		if (transport != null) {
			session.save(transport);
			return true;
		}
		return false;
	}

	public Transport findById(Long id) {
		return (Transport) session.get(Transport.class, id);
	}

	public List<Transport> findAll() {
		return session.createCriteria(Transport.class).list();
	}

}
